package com.colin.util.util;

import com.carrotsearch.sizeof.RamUsageEstimator;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhaolz
 * @date 2023/3/21 11:13
 */
public class ObjectCountUtil {

    public static void main(String[] args) {
        List<Object> list = new ArrayList<>();
        for (int i = 0; i < 10000; i++) {
            list.add("1232" + i);
        }
        System.out.println(RamUsageEstimator.sizeOf(list));
        System.out.println(RamUsageEstimator.humanSizeOf(list));
    }

}
